package com.sec.android.app.myfiles.util;

import android.content.Context;
import android.media.MediaScannerConnection;
import android.os.storage.StorageManager;
import android.os.storage.StorageVolume;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.List;

/**
 * Wrapper for classes which Robolectric does not support
 * Robolectric Shadow is not support
 * - java.* class
 * - API level 24.
 * - Sem functions.
 */
public class SemFwWrapper {
    public static File file(String path) {
        return new File(path);
    }

    public static File file(String path, String child) {
        return new File(path, child);
    }

    public static FileInputStream inputStream(File file) throws FileNotFoundException {
        return new FileInputStream(file);
    }

    public static FileOutputStream outputStream(File file) throws FileNotFoundException {
        return new FileOutputStream(file);
    }


    /**
     * @param storageManager
     * @return
     */
    public static List<StorageVolume> getStorageVolumes(StorageManager storageManager) {
        //TODO HYL
        return null;
        //return storageManager.getStorageVolumes();
    }

    public static String semGetPath(StorageVolume storageVolume) {
        //TODO HYL
        return null;
        //return storageVolume.semGetPath();
    }

    public static String getState(StorageVolume storageVolume) {
        //TODO HYL
        return null;
        //return storageVolume.getState();
    }

    public static int semGetMyUserId() {
        //TODO HYL UserId
        return 0;
    }

    public static void semScanDirectories(Context context, String[] directories, MediaScannerConnection.OnScanCompletedListener callback) {
        //TODO HYL ScanMedia
        //MediaScannerConnection.semScanDirectories(context, directories, callback);
    }
}
